import Vue from 'vue'
import Vuex from 'vuex'
import { setItem, getItem } from '../utils/storege'
Vue.use(Vuex)
// 引入本地localstorege封装数据
// this.$store===new Vuex.Store
export default new Vuex.Store({
  state: {
    user: getItem('TOU_TIAO')// 储存用户token
  },
  mutations: {
    userData (state, data) {
      state.user = data
      // 存到本地
      setItem('TOU_TIAO', data)
    }
  },
  actions: {
  },
  modules: {
  }
})
